package fr.umlv.escapeir.game;

import org.jbox2d.dynamics.Body;

import fr.umlv.escapeir.gesture.Direction;

public class Behaviors {
	
	public static final Behavior Inertia = new Behavior () {
		@Override
		public void apply() {}
	};
			
	public static LinearMove createLinearMove(Body b, Direction dir, int value) {
		int x = 0;
		int y = 0;
		switch(dir) {
			case DOWN:
				x = 0;
				y = -value;
				break;
			case DOWNLEFT:
				x = -value;
				y = -value;
				break;
			case DOWNRIGHT:
				x = value;
				y = -value;
				break;
			case LEFT:
				x = -value;
				y = 0;
				break;
			case RIGHT:
				x = value;
				y = 0;
				break;
			case TOP:
				x = 0;
				y = value;
				break;
			case TOPLEFT:
				x = -value;
				y = value;
				break;
			case TOPRIGHT:
				x = value;
				y = value;
				break;
			default:
				break;
		}
		LinearMove lm = new LinearMove(b, x, y);
		return lm;
	}

}
